package com.example.pfe;



import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.Button;
import android.widget.TextView;

public class bande1 extends Activity implements OnClickListener, TextWatcher {
	Button ajouter = null;
	 private TextView selection;
	   private AutoCompleteTextView choix;
	   private enum Semaine {Lundi, Mardi, Mercredi, Jeudi, Vendredi, Samedi, Dimanche};
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.interface_bande);
		selection = (TextView) findViewById(R.id.selection);
	      choix = (AutoCompleteTextView) findViewById(R.id.choix);
	      choix.addTextChangedListener(this);
	      choix.setAdapter(new ArrayAdapter<Semaine>(this, android.R.layout.simple_dropdown_item_1line, Semaine.values()));
	ajouter= (Button)findViewById(R.id.ajouter);
	ajouter.setOnClickListener(this);
      
	}
	public void onClick(View v) {
	if(v == ajouter){
			Intent monIntent = new Intent(this,bande.class);
	  	      startActivity(monIntent);
			
	 		}}
	public void beforeTextChanged(CharSequence chaine, int debut, int apres, int nombre) { }

	   public void onTextChanged(CharSequence chaine, int debut, int fin, int nombre) {
	      selection.setText(choix.getText());
	   }

	   public void afterTextChanged(Editable chaine) {  }

}
